import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/home.vue'
import Apply from './views/apply.vue'
import Preview from './views/preview.vue'
import Detail from './views/detail.vue'
import Applied from './views/applyResult.vue'
import Locked from './views/locked.vue'
import Config from './views/config.vue'
import Students from './views/students.vue'
import Material from './views/material.vue'

Vue.use(Router)

export default new Router({
    // mode: 'history',
    base: process.env.BASE_URL,
    routes: [
    {
        path: '/',
        redirect: '/home'
    },
    {
        path: '/home',
        name: 'home',
        meta: {
            title: '个人中心'
        },
        component: Home
    },
    {
        path: '/apply',
        name: 'apply',
        meta: {
            title: '注册申请'
        },
        component: Apply
    },
    {
        path: '/preview',
        name: 'preview',
        meta: {
            title: '课程列表'
        },
        component: Preview
    },
    {
        path: '/material',
        name: 'material',
        meta: {
            title: '课程教案'
        },
        component: Material
    },
    {
        path: '/detail/:id',
        name: 'detail',
        meta: {
            title: '课程详情'
        },
        component: Detail
    },
    {
        path: '/applied/:id',
        name: 'applyResult',
        meta: {
            title: '注册申请'
        },
        component: Applied
    },
    {
        path: '/locked',
        name: 'locked',
        meta: {
            title: '群主已被冻结'
        },
        component: Locked
    },
    {
        path: '/config',
        name: 'config',
        meta: {
            title: '课程设置'
        },
        component: Config
    },
    {
        path: '/students',
        name: 'sutdents',
        meta: {
            title: '我的学员'
        },
        component: Students
    },
    {
        path: '/poster',
        name: 'poster',
        meta: {
            title: '分享海报选择'
        },
        component: () => import( /* webpackChunkName: "poster" */ './views/poster.vue')
    }
]
})